package com.pc.service.impl;

import com.pc.enrty.ShoppingAddress;
import com.pc.mapper.ShoppingAddressMapper;
import com.pc.service.ShoppingAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class ShoppingAddressServiceImpl implements ShoppingAddressService {
    @Autowired
    private ShoppingAddressMapper shoppingAddressMapper;

    @Override
    public ArrayList<ShoppingAddress> findByUid(ShoppingAddress shoppingAddress) {
        return shoppingAddressMapper.selectByUid(shoppingAddress);
    }

    @Override
    public boolean addShoppingAddress(ShoppingAddress shoppingAddress) {
        return shoppingAddressMapper.insertShoppingAddress(shoppingAddress)==1?true:false;
    }

    @Override
    public boolean updateShoppingAddress(ShoppingAddress shoppingAddress) {
        return shoppingAddressMapper.updateShoppingAddress(shoppingAddress)==1?true:false;
    }

    @Override
    public ArrayList<ShoppingAddress> findId(ShoppingAddress shoppingAddress) {
        return shoppingAddressMapper.selectId(shoppingAddress);
    }
}
